/**
 * 该文件用于创建 actionCreator 并导出
 */

import { DNC, INC, INCBYNUM } from "./action-types";

export const add = () => {
  // 返回同步动作或异步动作，都可以
  return { type: INC };
};

export const jian = () => {
  // 返回动作对象
  return { type: DNC };
};

export const add10 = () => {
  // 返回一个带有 payload 的动作对象
  return { type: INCBYNUM, payload: 10 };
};

export const add20 = () => {
  return { type: INCBYNUM, payload: 20 };
};

export const addByNum = (payload: any) => {
  return { type: INCBYNUM, payload: payload };
};
